// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Google Tracing API Version v1
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://cloud.google.com/trace'>Google Tracing API</a>
 *      <tr><th>API Version<td>v1
 *      <tr><th>API Rev<td>20170316 (805)
 *      <tr><th>API Docs
 *          <td><a href='https://cloud.google.com/trace'>
 *              https://cloud.google.com/trace</a>
 *      <tr><th>Discovery Name<td>tracing
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Google Tracing API can be found at
 * <a href='https://cloud.google.com/trace'>https://cloud.google.com/trace</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.Tracing.v1
{
    /// <summary>The Tracing Service.</summary>
    public class TracingService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v1";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public TracingService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public TracingService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            projects = new ProjectsResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "tracing"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://tracing.googleapis.com/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return ""; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Google Tracing API.</summary>
        public class Scope
        {
            /// <summary>View and manage your data across Google Cloud Platform services</summary>
            public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform";

            /// <summary>Write Trace data for a project or application</summary>
            public static string TraceAppend = "https://www.googleapis.com/auth/trace.append";

            /// <summary>Read Trace data for a project or application</summary>
            public static string TraceReadonly = "https://www.googleapis.com/auth/trace.readonly";

        }



        private readonly ProjectsResource projects;

        /// <summary>Gets the Projects resource.</summary>
        public virtual ProjectsResource Projects
        {
            get { return projects; }
        }
    }

    ///<summary>A base abstract class for Tracing requests.</summary>
    public abstract class TracingBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new TracingBaseServiceRequest instance.</summary>
        protected TracingBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>V1 error format.</summary>
        [Google.Apis.Util.RequestParameterAttribute("$.xgafv", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<XgafvEnum> Xgafv { get; set; }

        /// <summary>V1 error format.</summary>
        public enum XgafvEnum
        {
            /// <summary>v1 error format</summary>
            [Google.Apis.Util.StringValueAttribute("1")]
            Value1,
            /// <summary>v2 error format</summary>
            [Google.Apis.Util.StringValueAttribute("2")]
            Value2,
        }

        /// <summary>OAuth access token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("access_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string AccessToken { get; set; }

        /// <summary>Data format for response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
            /// <summary>Media download with context-dependent Content-Type</summary>
            [Google.Apis.Util.StringValueAttribute("media")]
            Media,
            /// <summary>Responses with Content-Type of application/x-protobuf</summary>
            [Google.Apis.Util.StringValueAttribute("proto")]
            Proto,
        }

        /// <summary>OAuth bearer token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("bearer_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string BearerToken { get; set; }

        /// <summary>JSONP</summary>
        [Google.Apis.Util.RequestParameterAttribute("callback", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Callback { get; set; }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Pretty-print response.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("pp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> Pp { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>Legacy upload protocol for media (e.g. "media", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("uploadType", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadType { get; set; }

        /// <summary>Upload protocol for media (e.g. "raw", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("upload_protocol", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadProtocol { get; set; }

        /// <summary>Initializes Tracing parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "$.xgafv", new Google.Apis.Discovery.Parameter
                {
                    Name = "$.xgafv",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "access_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "access_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "bearer_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "bearer_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "callback", new Google.Apis.Discovery.Parameter
                {
                    Name = "callback",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "pp", new Google.Apis.Discovery.Parameter
                {
                    Name = "pp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "uploadType", new Google.Apis.Discovery.Parameter
                {
                    Name = "uploadType",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "upload_protocol", new Google.Apis.Discovery.Parameter
                {
                    Name = "upload_protocol",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "projects" collection of methods.</summary>
    public class ProjectsResource
    {
        private const string Resource = "projects";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public ProjectsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            traces = new TracesResource(service);

        }

        private readonly TracesResource traces;

        /// <summary>Gets the Traces resource.</summary>
        public virtual TracesResource Traces
        {
            get { return traces; }
        }

        /// <summary>The "traces" collection of methods.</summary>
        public class TracesResource
        {
            private const string Resource = "traces";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public TracesResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Sends new spans to Stackdriver Trace or updates existing spans. If the name of a trace that you
            /// send matches that of an existing trace, any fields in the existing trace and its spans are overwritten
            /// by the provided values, and any new fields provided are merged with the existing trace data. If the name
            /// does not match, a new trace is created with given set of spans.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="parent">ID of the Cloud project where the trace data is stored.</param>
            public virtual BatchUpdateRequest BatchUpdate(Google.Apis.Tracing.v1.Data.BatchUpdateSpansRequest body, string parent)
            {
                return new BatchUpdateRequest(service, body, parent);
            }

            /// <summary>Sends new spans to Stackdriver Trace or updates existing spans. If the name of a trace that you
            /// send matches that of an existing trace, any fields in the existing trace and its spans are overwritten
            /// by the provided values, and any new fields provided are merged with the existing trace data. If the name
            /// does not match, a new trace is created with given set of spans.</summary>
            public class BatchUpdateRequest : TracingBaseServiceRequest<Google.Apis.Tracing.v1.Data.Empty>
            {
                /// <summary>Constructs a new BatchUpdate request.</summary>
                public BatchUpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Tracing.v1.Data.BatchUpdateSpansRequest body, string parent)
                    : base(service)
                {
                    Parent = parent;
                    Body = body;
                    InitParameters();
                }


                /// <summary>ID of the Cloud project where the trace data is stored.</summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Tracing.v1.Data.BatchUpdateSpansRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "batchUpdate"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+parent}/traces:batchUpdate"; }
                }

                /// <summary>Initializes BatchUpdate parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                }

            }

            /// <summary>Returns a specific trace.</summary>
            /// <param name="name">ID of the trace. Format is `projects/PROJECT_ID/traces/TRACE_ID`.</param>
            public virtual GetRequest Get(string name)
            {
                return new GetRequest(service, name);
            }

            /// <summary>Returns a specific trace.</summary>
            public class GetRequest : TracingBaseServiceRequest<Google.Apis.Tracing.v1.Data.Trace>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string name)
                    : base(service)
                {
                    Name = name;
                    InitParameters();
                }


                /// <summary>ID of the trace. Format is `projects/PROJECT_ID/traces/TRACE_ID`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/traces/[^/]+$",
                        });
                }

            }

            /// <summary>Returns of a list of traces that match the specified filter conditions.</summary>
            /// <param name="parent">ID of the Cloud project where the trace data is stored.</param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Returns of a list of traces that match the specified filter conditions.</summary>
            public class ListRequest : TracingBaseServiceRequest<Google.Apis.Tracing.v1.Data.ListTracesResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>ID of the Cloud project where the trace data is stored.</summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>An optional filter for the request. Example: `version_label_key:a
                /// some_label:some_label_key` returns traces from version `a` and has `some_label` with
                /// `some_label_key`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string Filter { get; set; }

                /// <summary>End of the time interval (inclusive) during which the trace data was collected from the
                /// application.</summary>
                [Google.Apis.Util.RequestParameterAttribute("endTime", Google.Apis.Util.RequestParameterType.Query)]
                public virtual object EndTime { get; set; }

                /// <summary>Token identifying the page of results to return. If provided, use the value of the
                /// `next_page_token` field from a previous request. Optional.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Start of the time interval (inclusive) during which the trace data was collected from the
                /// application.</summary>
                [Google.Apis.Util.RequestParameterAttribute("startTime", Google.Apis.Util.RequestParameterType.Query)]
                public virtual object StartTime { get; set; }

                /// <summary>Maximum number of traces to return. If not specified or <= 0, the implementation selects a
                /// reasonable value. The implementation may return fewer traces than the requested page size.
                /// Optional.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }

                /// <summary>Field used to sort the returned traces. Optional. Can be one of the following:
                ///
                /// *   `trace_id` *   `name` (`name` field of root span in the trace) *   `duration` (difference
                /// between `end_time` and `start_time` fields of the root span) *   `start` (`start_time` field of the
                /// root span)
                ///
                /// Descending order can be specified by appending `desc` to the sort field (for example, `name desc`).
                ///
                /// Only one sort field is permitted.</summary>
                [Google.Apis.Util.RequestParameterAttribute("orderBy", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string OrderBy { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+parent}/traces"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                    RequestParameters.Add(
                        "filter", new Google.Apis.Discovery.Parameter
                        {
                            Name = "filter",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "endTime", new Google.Apis.Discovery.Parameter
                        {
                            Name = "endTime",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "startTime", new Google.Apis.Discovery.Parameter
                        {
                            Name = "startTime",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "orderBy", new Google.Apis.Discovery.Parameter
                        {
                            Name = "orderBy",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Returns a list of spans within a trace.</summary>
            /// <param name="name">ID of the trace for which to list child spans. Format is
            /// `projects/PROJECT_ID/traces/TRACE_ID`.</param>
            public virtual ListSpansRequest ListSpans(string name)
            {
                return new ListSpansRequest(service, name);
            }

            /// <summary>Returns a list of spans within a trace.</summary>
            public class ListSpansRequest : TracingBaseServiceRequest<Google.Apis.Tracing.v1.Data.ListSpansResponse>
            {
                /// <summary>Constructs a new ListSpans request.</summary>
                public ListSpansRequest(Google.Apis.Services.IClientService service, string name)
                    : base(service)
                {
                    Name = name;
                    InitParameters();
                }


                /// <summary>ID of the trace for which to list child spans. Format is
                /// `projects/PROJECT_ID/traces/TRACE_ID`.</summary>
                [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Name { get; private set; }

                /// <summary>Token identifying the page of results to return. If provided, use the value of the
                /// `nextPageToken` field from a previous request. Optional.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "listSpans"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v1/{+name}:listSpans"; }
                }

                /// <summary>Initializes ListSpans parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "name", new Google.Apis.Discovery.Parameter
                        {
                            Name = "name",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/traces/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
    }
}

namespace Google.Apis.Tracing.v1.Data
{    

    /// <summary>Text annotation with a set of attributes.</summary>
    public class Annotation : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A set of attributes on the annotation.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("attributes")]
        public virtual System.Collections.Generic.IDictionary<string,AttributeValue> Attributes { get; set; } 

        /// <summary>A user-supplied message describing the event.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("description")]
        public virtual string Description { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The allowed types for the value side of an attribute key:value pair.</summary>
    public class AttributeValue : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A boolean value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("boolValue")]
        public virtual System.Nullable<bool> BoolValue { get; set; } 

        /// <summary>An integer value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("intValue")]
        public virtual System.Nullable<long> IntValue { get; set; } 

        /// <summary>A string value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("stringValue")]
        public virtual string StringValue { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The request message for the `BatchUpdateSpans` method.</summary>
    public class BatchUpdateSpansRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A map from trace name to spans to be stored or updated.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("spanUpdates")]
        public virtual System.Collections.Generic.IDictionary<string,SpanUpdates> SpanUpdates { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A
    /// typical example is to use it as the request or the response type of an API method. For instance:
    ///
    /// service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
    ///
    /// The JSON representation for `Empty` is empty JSON object `{}`.</summary>
    public class Empty : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A pointer from this span to another span in a different `Trace`. Used (for example) in batching
    /// operations, where a single batch handler processes multiple requests from different traces.</summary>
    public class Link : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The `id` of the linked span.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("spanId")]
        public virtual System.Nullable<ulong> SpanId { get; set; } 

        /// <summary>The ID of the parent trace of the linked span.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("traceId")]
        public virtual string TraceId { get; set; } 

        /// <summary>The relationship of the current span relative to the linked span.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The response message for the `ListSpans` method.</summary>
    public class ListSpansResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If defined, indicates that there are more spans that match the request. Pass this as the value of
        /// `pageToken` in a subsequent request to retrieve additional spans.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The requested spans if there are any in the specified trace.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("spans")]
        public virtual System.Collections.Generic.IList<Span> Spans { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The response message for the `ListTraces` method.</summary>
    public class ListTracesResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If defined, indicates that there are more traces that match the request and that this value should
        /// be passed to the next request to continue retrieving additional traces.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>List of trace records returned.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("traces")]
        public virtual System.Collections.Generic.IList<Trace> Traces { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Binary module.</summary>
    public class Module : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Build_id is a unique identifier for the module, usually a hash of its contents</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("buildId")]
        public virtual string BuildId { get; set; } 

        /// <summary>E.g. main binary, kernel modules, and dynamic libraries such as libc.so, sharedlib.so</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("module")]
        public virtual string ModuleValue { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>An event describing an RPC message sent/received on the network.</summary>
    public class NetworkEvent : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If available, this is the kernel time:
        ///
        /// *  For sent messages, this is the time at which the first bit was sent. *  For received messages, this is
        /// the time at which the last bit was received.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kernelTime")]
        public virtual object KernelTime { get; set; } 

        /// <summary>An identifier for the message, which must be unique in this span.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("messageId")]
        public virtual System.Nullable<ulong> MessageId { get; set; } 

        /// <summary>The number of bytes sent or received.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("messageSize")]
        public virtual System.Nullable<ulong> MessageSize { get; set; } 

        /// <summary>Type of NetworkEvent. Indicates whether the RPC message was sent or received.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A span represents a single operation within a trace. Spans can be nested to form a trace tree. Often, a
    /// trace contains a root span that describes the end-to-end latency and, optionally, one or more subspans for its
    /// sub-operations. (A trace could alternatively contain multiple root spans, or none at all.) Spans do not need to
    /// be contiguous. There may be gaps and/or overlaps between spans in a trace.</summary>
    public class Span : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Properties of a span in key:value format. The maximum length for the key is 128 characters. The
        /// value can be a string (up to 2000 characters), int, or boolean.
        ///
        /// Some common pair examples:
        ///
        /// "/instance_id": "my-instance" "/zone": "us-central1-a" "/grpc/peer_address": "ip:port" (dns, etc.)
        /// "/grpc/deadline": "Duration" "/http/user_agent" "/http/request_bytes": 300 "/http/response_bytes": 1200
        /// "/http/url": google.com/apis "abc.com/myattribute": true</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("attributes")]
        public virtual System.Collections.Generic.IDictionary<string,AttributeValue> Attributes { get; set; } 

        /// <summary>True if this span has a remote parent (is an RPC server span).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("hasRemoteParent")]
        public virtual System.Nullable<bool> HasRemoteParent { get; set; } 

        /// <summary>Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual System.Nullable<ulong> Id { get; set; } 

        /// <summary>A collection of links, which are references from this span to another span in a different
        /// trace.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("links")]
        public virtual System.Collections.Generic.IList<Link> Links { get; set; } 

        /// <summary>End time of the span. On the client side, this is the local machine clock time at which the span
        /// execution was ended; on the server side, this is the time at which the server application handler stopped
        /// running.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("localEndTime")]
        public virtual object LocalEndTime { get; set; } 

        /// <summary>Start time of the span. On the client side, this is the local machine clock time at which the span
        /// execution was started; on the server side, this is the time at which the server application handler started
        /// running.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("localStartTime")]
        public virtual object LocalStartTime { get; set; } 

        /// <summary>Name of the span. The span name is sanitized and displayed in the Stackdriver Trace tool in the {%
        /// dynamic print site_values.console_name %}. The name may be a method name or some other per-call site name.
        /// For the same executable and the same call point, a best practice is to use a consistent name, which makes it
        /// easier to correlate cross-trace spans.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>ID of the parent span. If this is a root span, the value must be `0` or empty.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("parentId")]
        public virtual System.Nullable<ulong> ParentId { get; set; } 

        /// <summary>Stack trace captured at the start of the span.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("stackTrace")]
        public virtual StackTrace StackTrace { get; set; } 

        /// <summary>An optional final status for this span.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("status")]
        public virtual Status Status { get; set; } 

        /// <summary>A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation on the span, consisting of
        /// either user-supplied key:value pairs, or details of an RPC message sent/received on the network.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("timeEvents")]
        public virtual System.Collections.Generic.IList<TimeEvent> TimeEvents { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Collection of spans to update.</summary>
    public class SpanUpdates : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A collection of spans.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("spans")]
        public virtual System.Collections.Generic.IList<Span> Spans { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Represents a single stack frame in a stack trace.</summary>
    public class StackFrame : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Column number is important in JavaScript (anonymous functions). May not be available in some
        /// languages.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("columnNumber")]
        public virtual System.Nullable<long> ColumnNumber { get; set; } 

        /// <summary>The filename of the file containing this frame.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("fileName")]
        public virtual string FileName { get; set; } 

        /// <summary>The fully-qualified name that uniquely identifies this function or method.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("functionName")]
        public virtual string FunctionName { get; set; } 

        /// <summary>Line number of the frame.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("lineNumber")]
        public virtual System.Nullable<long> LineNumber { get; set; } 

        /// <summary>Binary module the code is loaded from.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("loadModule")]
        public virtual Module LoadModule { get; set; } 

        /// <summary>Used when the function name is [mangled](http://www.avabodh.com/cxxin/namemangling.html). May be
        /// fully-qualified.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("originalFunctionName")]
        public virtual string OriginalFunctionName { get; set; } 

        /// <summary>The version of the deployed source code.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("sourceVersion")]
        public virtual string SourceVersion { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>StackTrace collected in a trace.</summary>
    public class StackTrace : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Stack frames of this stack trace.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("stackFrame")]
        public virtual System.Collections.Generic.IList<StackFrame> StackFrame { get; set; } 

        /// <summary>The hash ID is used to conserve network bandwidth for duplicate stack traces within a single trace.
        ///
        /// Often multiple spans will have identical stack traces. The first occurance of a stack trace should contain
        /// both the `stackFrame` content and a value in `stackTraceHashId`.
        ///
        /// Subsequent spans within the same request can refer to that stack trace by only setting
        /// `stackTraceHashId`.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("stackTraceHashId")]
        public virtual System.Nullable<ulong> StackTraceHashId { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The `Status` type defines a logical error model that is suitable for different programming
    /// environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). The error model
    /// is designed to be:
    ///
    /// - Simple to use and understand for most users - Flexible enough to meet unexpected needs
    ///
    /// # Overview
    ///
    /// The `Status` message contains three pieces of data: error code, error message, and error details. The error code
    /// should be an enum value of google.rpc.Code, but it may accept additional error codes if needed.  The error
    /// message should be a developer-facing English message that helps developers *understand* and *resolve* the error.
    /// If a localized user-facing error message is needed, put the localized message in the error details or localize
    /// it in the client. The optional error details may contain arbitrary information about the error. There is a
    /// predefined set of error detail types in the package `google.rpc` which can be used for common error conditions.
    ///
    /// # Language mapping
    ///
    /// The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire
    /// format. When the `Status` message is exposed in different client libraries and different wire protocols, it can
    /// be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped
    /// to some error codes in C.
    ///
    /// # Other uses
    ///
    /// The error model and the `Status` message can be used in a variety of environments, either with or without APIs,
    /// to provide a consistent developer experience across different environments.
    ///
    /// Example uses of this error model include:
    ///
    /// - Partial errors. If a service needs to return partial errors to the client, it may embed the `Status` in the
    /// normal response to indicate the partial errors.
    ///
    /// - Workflow errors. A typical workflow has multiple steps. Each step may have a `Status` message for error
    /// reporting purpose.
    ///
    /// - Batch operations. If a client uses batch request and batch response, the `Status` message should be used
    /// directly inside batch response, one for each error sub-response.
    ///
    /// - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of
    /// those operations should be represented directly using the `Status` message.
    ///
    /// - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any
    /// stripping needed for security/privacy reasons.</summary>
    public class Status : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The status code, which should be an enum value of google.rpc.Code.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("code")]
        public virtual System.Nullable<int> Code { get; set; } 

        /// <summary>A list of messages that carry the error details.  There will be a common set of message types for
        /// APIs to use.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("details")]
        public virtual System.Collections.Generic.IList<System.Collections.Generic.IDictionary<string,object>> Details { get; set; } 

        /// <summary>A developer-facing error message, which should be in English. Any user-facing error message should
        /// be localized and sent in the google.rpc.Status.details field, or localized by the client.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("message")]
        public virtual string Message { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A time-stamped annotation in the Span.</summary>
    public class TimeEvent : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>One or more key:value pairs.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("annotation")]
        public virtual Annotation Annotation { get; set; } 

        /// <summary>The timestamp indicating the time the event occurred.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("localTime")]
        public virtual object LocalTime { get; set; } 

        /// <summary>An event describing an RPC message sent/received on the network.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("networkEvent")]
        public virtual NetworkEvent NetworkEvent { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A trace describes how long it takes for an application to perform some operations. It consists of a set
    /// of spans, each representing an operation and including time information and operation details.</summary>
    public class Trace : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A globally unique identifier for the trace in the format `projects/PROJECT_NUMBER/traces/TRACE_ID`.
        /// `TRACE_ID` is a base16-encoded string of a 128-bit number and is required to be 32 char long.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
